import Vue from "vue";

import "element-ui/lib/theme-chalk/index.css"; //默认样式

import {
  Button,
  Message,
  Radio,
  Form,
  FormItem,
  Input,
  Menu,
  MenuItem,
  Submenu,
  Breadcrumb,
  BreadcrumbItem,
  Table,
  TableColumn,
  ColorPicker,
  Loading,
  Pagination,
  Tree,
  Dialog,
  Switch
} from "element-ui";
Vue.prototype.$ELEMENT = { size: "medium" };
Vue.use(Button)
  .use(Radio)
  .use(Form)
  .use(Input)
  .use(Menu)
  .use(MenuItem)
  .use(Breadcrumb)
  .use(BreadcrumbItem)
  .use(Submenu)
  .use(Table)
  .use(TableColumn)
  .use(ColorPicker)
  .use(Pagination)
  .use(Loading)
  .use(Tree)
  .use(Dialog)
  .use(Switch)
  .use(FormItem);

// Dialog弹窗默认props
Dialog.props.closeOnClickModal.default = false;
Dialog.props.closeOnPressEscape.default = false;
// Table表格默认props
Table.props.border.default = true;
TableColumn.props.showOverflowTooltip.default = true;
// message提示
Vue.prototype.$message = function(option) {
  return Message({
    duration: 1000,
    ...option
  });
};
